using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MFramework;

public class GameController : MonoBehaviour
{
    public GameObject canvasGO;

    private AssetHandle m_gameHandle;

    private void Awake()
    {
        ResourcesManager.Initialize(InitGame);
    }

    private void InitGame()
    {
        m_gameHandle = ResourcesManager.LoadAsset<GameObject>("Assets/GameRes/Prefabs/UIGame");
        m_gameHandle.InstantiateSync(canvasGO.transform);
    }

    private void OnDestroy()
    {
        if(m_gameHandle != null)
        {
            m_gameHandle.Release();
            m_gameHandle = null;
        }
    }
}
